//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {

        FlyweightFactory factory = new FlyweightFactory();
        Flyweight flyweightTom = factory.getFlywight("Tom");
        Flyweight flyweightJerry =factory.getFlywight("Jerry");

        System.out.println(flyweightTom.operation()+flyweightTom.hashCode());
        System.out.println(flyweightJerry.operation()+flyweightJerry.hashCode());

        flyweightTom = factory.getFlywight("Tom");
        System.out.println(flyweightTom.operation()+flyweightTom.hashCode());



        //TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
        // to see how IntelliJ IDEA suggests fixing it.

    }
}